import request from './ajax'

// 注册
export const reqRegister = (userInfo) => request('/register', userInfo, 'POST')

// 登录
export const reqLogin = (userInfo) => request('/login', userInfo, 'POST')

// 更新用户信息
export const reqUpdate = (data) => request('/update', data, 'POST')

// 获取当前的user(自动携带Cookie中的userid)
export const reqUser = () => request('/user')

// 获取用户列表
export const reqUserList = (type) => request('/userlist', {type})

// 获取用户的消息列表(自动携带Cookie中的userid)
export const reqMessagelist = () => request('/msglist')

// 修改消息状态为已读
export const reqReadMessage = (from) => request('/readmsg', {from}, 'POST')
